<#setting number_format=",###.###">
<#setting classic_compatible="true">
<style  type="text/css" id="printStyle">

#pageHead,#printHead,#tableArea,#remark,#printFooter,#pageFooter{
    font-family: Times New Roman;
    line-height: 22px;
    font-size: 12px;
}

td,tr,talbe {
	margin: 0;
	padding: 0;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
	border-spacing: 0 !important;
	*border-collapse: expression('separate', cellSpacing =   '0px');/
	border-spacing: expression(this.cellSpacing = 0);
}

td,th {
	display: table-cell;
	vertical-align: inherit;
}

table th,table td {
	text-align: left;
}

.printTable {
	width: 100%;
	margin: 0;
	padding: 0;
}

.printTable td {
	word-wrap:break-word;
    word-break:break-all;
}

.printTable tr {
	width: 100%;
}
.printLine td{
    font-weight: bold;
}
.printTable .printLine td {
	line-height: 30px;
	border-top: 1px solid gray;
	border-bottom: 1px solid gray;
}
</style>
<div id="pageHead" style="width: 740px;">
    <div style="height: 100px">
        <div style="width: 180px;float: left;">
            <img alt="" src="${staticDomain}images/system/logo/logo-middle.jpg" width="180" height="84"/>
        </div>
        <div style="line-height: 30px; font-size:${fontSize}em;font-weight:bolder; text-align: center;width:620px;float: left;margin-left:100px;margin-top: -80px;">${entity.company.name!}</div>
        <div style="line-height: 30px; text-align: center;font-size:${fontSize-0.2}em;width:400px;float: right;margin: -30px 115px 0;">Invoice</div>
    </div>   
</div>
<div id="printHead" style="width: 740px;">
    <table border="0" cellspacing="0" cellpadding="0" width="100%" style="margin-top:15px;" class="printTable">
        <tbody> 
            <tr>
                <td width="3%">TO</td>
                <td width="47%">:${entity.customer.name!}</td>
                <td width="15%" style="vertical-align: top;">P/I No.</td>
                <td width="35%">:${orderNo!}</td>
            </tr>
            <tr>
                <td style="vertical-align: top;">Add</td>
                <td style="vertical-align: top;">:${entity.customer.address!}</td>
                <td>Packing No</td>
                <td>:${packingNo!}</td>
            </tr>
            <tr>
                <td>Tel</td>
                <td>:${entity.customer.linkTelephone!}</td>
                <td>Invoice No</td>
                <td>:${entity.no!}</td>
            </tr>
            <tr>
                <td>Fax</td>
                <td>:${entity.customer.fax!}</td>
                <td>Date</td>
                <td>:${entity.invoiceDate?string("yyyy-MM-dd")}</td>
            </tr>
            <tr>
                <td rowspan="9" style="vertical-align: top;">Attn</td>
                <td rowspan="9" style="vertical-align: top;">:${entity.customer.linkPerson!}</td>
                <td>SHIPMENT</td>
                <td>:${entity.shipment!}</td>
            </tr>
            <tr>
               <td>Ship Name</td>
               <td>:${entity.shipName}</td>
            </tr>
            <tr>
               <td>On board date</td>
               <td>:${entity.shipDate?string("yyyy-MM-dd")}</td>
            </tr>
            <tr>
               <td>BL No</td>
               <td>:${entity.blNo!}</td>
            </tr>
            <tr>
               <td>Payment due</td>
               <td>:${entity.predictPayDate?string("yyyy-MM-dd")}</td>
            </tr>
            <tr>
               <td>Payment term</td>
               <td>:${entity.payment}</td>
            </tr>
            <tr>
                <td>Seal No</td>
                <td>:${sealNo!}</td>
            </tr>
            <tr>
                <td>Container</td>
                <td>:${containerNo!}</td>
            </tr>
            <tr>
                <td>ETA Date</td>
                <td>:<#if entity.eta??>${entity.eta?string("yyyy-MM-dd")}</#if></td>
            </tr>
        </tbody>
    </table>
</div>
<div id="tableArea">
    <table class="printTable" style="margin-top: 15px;">
       <caption>
           <div style="line-height: 30px;margin-bottom:15px" align="left">Subject
                to our confirmation on the above terms and conditions: We take
                pleasure in offering you the under mentioned commodities, <span style="font-weight: bolder;">Client Order Number:${clientPoNo!}</span>
            </div>
       </caption>
        <thead>
            <tr class="printLine">
                <td width="15%">Purchase No.</td>
                <td width="10%">Quantity</td>
                <td width="45%">Description</td>
                <td width="15%">Unit Price</td>
                <td width="15%">Amount</td>
            </tr>
        </thead>
        <tbody>
            <#list orderItems as item>
            <tr>
                <td style="text-align: left;">&#160;${item.customerPerchaseNo }</td>
                <td style="text-align: left;">&#160;${item.quantity }</td>
                <td style="text-align: left;">&#160;${item.productDecription }</td>
                <td style="text-align: left;">&#160;${item.unitPrice }</td>
                <td style="text-align: left;">&#160;${item.quantity * item.unitPrice}</td>
            </tr>
            </#list>
            <#list chargeItems as item>
            <tr>
                <td style="text-align: left;" colspan="2">&#160;</td>
                <td style="text-align: left;">&#160;${item.chargeName }</td>
                <td style="text-align: left;">&#160;</td>
                <td style="text-align: left;">&#160;${item.charge}</td>
            </tr>
            </#list>
            <tr class="printLine">
                <td colspan="3" style="text-align: left;">Total</td>
                <td style="text-align: right;">${currency}</td>
                <td style="text-align: left;">${entity.total}</td>
            </tr>
        </tbody>
    </table>
</div>
<div id="printFooter">
    <div style="vertical-align: bottom;margin-top:40px;height: 130px;">
         <div style="float: left;width: 100%;text-align: left;">
               Beneficiary:${entity.company.name!}<br>
               Bank Name:${entity.company.bankName!}<br>
               Bank Account No:${entity.company.bankNo!}<br>
               Bank Account Name:${entity.company.bankAccountName!}<br>
               Bank Swift Code:${entity.company.swiftCode!}<br>
               Bank Address:${entity.company.bankAddress!}
        </div>
    </div>
    <div style="vertical-align: bottom;margin-top:20px;height: 210px;width: 740px;">
        <div style="float: left;width: 100%;height: 60px;text-align: left;">
            Confirmed by<br/>
             <div style="float:left;width: 350px;">${entity.customer.name!}</div>
             <div style="float:right;width: 350px;text-align: left;">${entity.company.name!}</div>
        </div>
        <div style="margin: -60px 0 0 400px; float: left;">
            <img border="0" transcolor="#FFFFFF" src="${staticDomain}images/system/company/${entity.company.officialSeal}"  style="z-index: -1;" />
        </div>
        <div style="margin: 0px 0 0 -80px;float: left;width: 100px;">
            <#if signature??>
              <img src="${staticDomain}images/system/personal/${signature}" transcolor="#FFFFFF" style="z-index: -1;"/>
            </#if>
        </div>
    </div>
</div>
